#!/bin/bash
set -e

if [ -z "$(which pipenv)" ]; then
  echo "A local pipenv installation is required for python development." >&2
  exit 127
fi


# setup test fixtures
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/pipenv

# clean up any previous fixture venv that might have been created.
if [ "$1" == "-f" ]; then
    echo "removing old fixture setup..."
    pipenv --rm || true
fi

# set up a virtualenv and install the packages in the test requirements
pipenv install
